<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/vue@2.6.14/dist/vue.js"></script>

</head>
<body>
    <div class="root">
        姓：<input type="text" v-model:value="fname">
        名：<input type="text" v-model:value="lname">
        <br>
        姓名：<span>{{fname.slice(0,3)+lname}}</span>
        <br>
        姓名：<span>{{fname}} {{lname}}</span>
        <br>
        xm:<span>{{fullname()}}</span>
    </div>
    
    <script>
            new Vue({
                el:".root",
                data:{
                    fname:"zhang",
                    lname:"san"
                },
                methods:{
                    fullname(){
                       console.log(this);
                        return this.fname+" "+this.lname
                    }
                }
            })

    </script>
</body>
</html>